package com.gang.mars.basic.jvm;

import java.util.ArrayList;
import java.util.Random;

/**
 * 类说明：gang.chen springboot深度实践
 *
 * @author gang.chen
 * @since 2022/7/10
 */
public class OOMTest {

    public static void main(String[] args) throws InterruptedException {
        int i = 0;
        ArrayList<Picture> list = new ArrayList<>();
        while (true){
            Thread.sleep(5);
            list.add(new Picture(new Random().nextInt(100*50)));
            System.out.println("OOMTest.main " + i++);
        }
    }

}

class Picture{
    private byte[] pixels;

    public Picture(int length){
        this.pixels = new byte[length];
    }
}
